package com.ctshk.rpc.finance.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ctshk.rpc.finance.dto.advance.AdvanceChargeApplyDTO;
import com.ctshk.rpc.finance.entity.FinanceAdvanceChargeApply;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 财务预付款申请表 Mapper 接口
 * </p>
 *
 * @author 叶冠峰
 * @since 2021-04-08
 */
public interface FinanceAdvanceChargeApplyMapper extends BaseMapper<FinanceAdvanceChargeApply> {

    /**
     * 申请记录
     * @param id
     * @return
     */
    @Select("SELECT id,money_amount,currency,payment_method_name,business_type,pay_time_begin,pay_time_end,approval_status,create_id,gmt_create\n" +
            "FROM t_finance_advance_charge_apply\n" +
            "WHERE advance_charge_id = #{advance_charge_id} AND is_deleted = 0 ORDER BY gmt_create DESC")
    List<AdvanceChargeApplyDTO> queryByCharge(@Param("advance_charge_id")Long id);
}
